import request from '@/utils/request'
import { praseStrEmpty } from "@/utils/tykj";


// 查询商品类别列表
export function listCategory(userId) {
    return request({
      url: '/material/category/getMaterialCategoryTree/' + userId,
      method: 'get'
    })
  }
// 根据id查询商品类别
export function getMaterialCategory(userId) {
  return request({
    url: '/material/category/getMaterialCategory/' + userId,
    method: 'get'
  })
}

// 新增商品类别列表
export function addCategory(data) {
    return request({
      url: '/material/category/save',
      method: 'post',
      data: data
    })
  }

// 修改商品类别
export function updateCategory(data) {
    return request({
      url: '/material/category/update',
      method: 'put',
      data: data
    })
  }

//验证名称

export function checkCategory(query) {
    return request({
    url: '/material/category/checkIsNameExist',
    method: 'get',
    params: query
    })
}
  
  
  // 删除用户
  export function delCategory(userId) {
    return request({
      url: '/material/category/delete/' + userId,
      method: 'delete'
    })
  }


  